import React from 'react';
import { Button } from 'antd';
import { TablePro } from '@ecoding/components.antd';
import { getColumns, getOperationColumns } from './columns';
import SearchInput from './search.input';
import Filters from './filters';

const C = () => {

    const data = [
        {
            id: 1,
            title: "cxc"
        },
        {
            id: 2,
            title: "wc"
        }
    ]

    // const pagination = useMemo(
    //     () => ({
    //         current: filtersRef.current.pageNo,
    //         pageSize: filtersRef.current.pageSize,
    //         total: listUse.res?.total,
    //         showTotal: (total) => i18n.$t('global.total.item', { total }),
    //         showTitle: true,
    //         showSizeChanger: true,
    //         onChange: async (v: number, m: number) => {
    //             filtersRef.current.pageNo = v;
    //             filtersRef.current.pageSize = m;
    //             filterStore.setFilterMap(location.pathname, filtersRef.current);
    //             await fresh();
    //         }
    //     }),
    //     [listUse.res?.list]
    // );

    return (
        <TablePro
            className="pt16 pl20 pr20"
            buttonArea={
                <Button type="primary">
                    新增
                </Button>
            }
            searchInputArea={
                <SearchInput />
            }
            filterArea={<Filters />}
            columns={getColumns()}
            operationColumn={getOperationColumns()}
            rowKey="id"
            dataSource={data}
            // pagination={pagination}
            filterTitle="筛选"
            columnsTitle="显示列"
        />
    );
}

export default C;